if [[ $# -lt 2 ]]
then echo "Usage: $0 year month1 month2";
     echo "       to add some months to SBBX.HadR2"
     exit; fi

if [[ ! -s input_files/SBBX.HadR2 ]] 
then echo "file input_files/SBBX.HadR2 not found" ; exit ; fi

mo=$2 ; if [[ mo -lt 10 ]] ; then mo='0'${mo} ; fi
if [[ ! -s input_files/oiv2mon.$1$mo ]]
then echo "file input_files/oiv2mon.$1$mo not found" ; exit ; fi

mo2=$2 ; if [[ $# -gt 2 ]]; then mo2=$3 ; fi

# f90 convert1.HadR2_mod4.f -o convert1.HadR2_mod4.exe
convert1.HadR2_mod4.exe $1 $2 $mo2
trimSBBX SBBX.HadR2.upd

echo 'If all went ok, type "mv SBBX.HadR2.upd input_files/SBBX.HadR2"'
echo '          then  type: do_comb_step5.sh 100 0'
